package com.viknix.threadpool.manager.client.http;

import com.viknix.threadpool.manager.client.http.HttpSimpleClient.HttpResult;

import java.io.IOException;
import java.util.List;

/**
 * @Author: Dongqi
 * @Date: 2021/10/22 15:41
 * @Version 1.0
 * @Description: HttpAgent
 */
public interface HttpAgent {

    /**
     * start to get tpm ip list
     */
    void start();

    /**
     * invoke http get method
     *
     * @param path          http path
     * @param headers       http headers
     * @param paramValues   http paramValues http
     * @param encoding      http encode
     * @param readTimeoutMs http timeout
     * @return HttpResult http response
     * @throws IOException If an input or output exception occurred
     */
    HttpResult httpGet(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException;

    /**
     * invoke http post method
     *
     * @param path          http path
     * @param headers       http headers
     * @param paramValues   http paramValues http
     * @param encoding      http encode
     * @param readTimeoutMs http timeout
     * @return HttpResult http response
     * @throws IOException If an input or output exception occurred
     */
    HttpResult httpPost(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException;

    /**
     * invoke http delete method
     *
     * @param path          http path
     * @param headers       http headers
     * @param paramValues   http paramValues http
     * @param encoding      http encode
     * @param readTimeoutMs http timeout
     * @return HttpResult http response
     * @throws IOException If an input or output exception occurred
     */
    HttpResult httpDelete(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException;

    /**
     * get name
     *
     * @return String
     */
    String getName();

    /**
     * Get tenant id.
     *
     * @return
     */
    String getNamespace();

    /**
     * Get encode.
     *
     * @return
     */
    String getEncode();
}

